﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Configuration;

namespace Musicman.Utilities.Configuration.Search
{
    public class SearchJobConfigurationElement : ConfigurationElement
    {
        [ConfigurationProperty("name", IsRequired = true, DefaultValue = "")]
        public string Name
        {
            get { return (string)this["name"]; }
            set { this["name"] = value; }
        }

        [ConfigurationProperty("criteria", IsRequired = true, DefaultValue = "")]
        public string Criteria
        {
            get { return (string)this["criteria"]; }
            set { this["criteria"] = value; }
        }

        [ConfigurationProperty("searchtype", IsRequired = true, DefaultValue = SearchType.Local)]
        public SearchType SearchType
        {
            get { return (SearchType)this["searchtype"]; }
            set { this["criteria"] = value; }
        }

        [ConfigurationProperty("minfilesize", IsRequired = false, DefaultValue = Int64.MinValue)]
        public long MinFileSize
        {
            get { return (long)this["minfilesize"]; }
            set { this["minfilesize"] = value; }
        }

        [ConfigurationProperty("maxfilesize", IsRequired = false, DefaultValue = Int64.MaxValue)]
        public long MaxFileSize
        {
            get { return (long)this["maxfilesize"]; }
            set { this["maxfilesize"] = value; }
        }
    }

    public enum SearchType : byte
    {
        Local,
        Network
    }

}
